<template>
    <div>
      <span ref="myCount">count:{{ count }}</span>
      <button @click="toAdd">+1</button>
    </div>
  </template>
  
  <script>
  export default {
    data(){
      return{
        count: 0
      }
    },
    updated(){
      console.log('print2',this.$refs.myCount.innerText);
    },
    methods:{
      toAdd(){
        this.count++
        console.log('count',this.count);
        console.log('print1',this.$refs.myCount.innerText);
        this.$nextTick(()=>{
          console.log('print3',this.$refs.myCount.innerText);
        })
      }
    }
  }
  </script>
  
  <style>
  
  </style>